package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.statistic.dtos.StatisticsDto;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.wemedia.service.WmNewsStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/statistics")
public class WmStatisticsController {

    @Autowired
    WmNewsStatisticsService wmNewsStatisticsService;
    //数据统计
    @PostMapping ("/news")
    public ResponseResult updateWmNews(@RequestBody StatisticsDto dto) {
       return wmNewsStatisticsService.watchStatistics(dto);
    }

    //粉丝概况
    @PostMapping ("/fans")
    public ResponseResult fansListHand(@RequestBody StatisticsDto dto) {
        return wmNewsStatisticsService.fansListHand(dto);
    }

}
